package com.yckj.day02;

/**
 * TODO Switch案例2
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/17 15:57
 */
public class SwitchDemo2 {
    public static void main(String[] args) {
        String s = "apple";
        switch (s) { // switch可以跟字符串
            case "banana":
                System.out.println("香蕉");
                break;
            case "apple":
                System.out.println("苹果");
                break;
            case "pear":
                System.out.println("梨子");
                break;
            default:
                System.out.println("未知");
                break;
        }


    }
}

